#ifndef CONFIG_H
#define CONFIG_H

/*include*/
#include "stm32f1xx_hal.h"
#include "c_pin.hpp"
#include "c_i2c.hpp"
#include "c_tim.hpp"
#include "myints.h"

/* macro switch, use `//` to disable */
//#define USE_VIRTUAL
#define USE_DMA
#define USE_USB
#define USE_FREERTOS
//#define USE_FLOAT

/* consts for the libaray */
#define TOTAL_GPIO_PORTS 3 //GPIOx(x=ABC)
#define TOTAL_ADCs 2       //ADC1, ADC2
#define REF_NSAMP  9       //NSAMP for CH16 ref
#define MV_MUL    10    //multiply to result, can improve accuracy, too big maybe overflow!


#ifdef USE_FREERTOS
#include "cmsis_os2.h"
#include "FreeRTOS.h"
#define XMalloc pvPortMalloc
#define XFree vPortFree
#define XDelayMs osDelay
#define XDelayUs Delay_us
#else
#include <stdlib.h>
#define XMalloc malloc
#define XFree free
#define XDelayMs HAL_Delay
#endif

#ifdef USE_USB
#include "usbd_customhid.h"
#endif

#endif
